package xyz.luhui1hao.collection.collection;

import java.util.Arrays;
import java.util.Stack;

/**
 * @ClassName ListMain
 * @Description TODO
 * @Author luhui1hao
 * @Date 2018/9/26 4:02 PM
 * @Version 1.0
 */
public class ListMain {
    public static void main(String[] args){
        Stack<Integer> stack = new Stack<>();

        stack.push(1);
        stack.push(2);
        stack.push(3);
        stack.push(4);
        stack.push(5);

        System.out.println(Arrays.toString(stack.toArray()));
        //弹栈，先进后出
        while(stack.size() > 0){
            stack.pop();
            System.out.println(Arrays.toString(stack.toArray()));
        }

    }
}
